<%@ page language="java" %>

<%@ page import="com.scalar.chiptrack.commons.SessionKeys,
                 com.scalar.chiptrack.utils.ConfigManager,
				 com.scalar.chiptrack.commons.Constants,
				 com.scalar.chiptrack.users.Functionality,
				 com.scalar.chiptrack.users.User,
                 com.scalar.chiptrack.operations.release.forms.TestReleaseSearchForm"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<chiptrack:checkLogon sourcePage="/testRelease.do" />
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet"></HEAD>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/assembly_release.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/quickSearch.js"></script>

<SCRIPT language="JavaScript">
window.onload = init;

function init()
{
    qs_1 = new QuickSearch(document.testReleaseSearchForm.processStep_ID, document.testReleaseSearchForm.qs1, false);
}
<% int vendorID = ((TestReleaseSearchForm)request.getAttribute("testReleaseSearchForm")).getVendor_ID();%>


function generateProgramRelease( salesOrder_Id, lineItem_id )
{
	document.testReleaseSearchForm.action = "<%=chipTracContext%>/testRelease.do?action=release&salesOrder_Id="+ salesOrder_Id +"&lineItem_Id=" + lineItem_id+"&vendor_Id="+document.testReleaseSearchForm.vendor_ID.value;
	document.testReleaseSearchForm.submit();
}

function reset()
{
    document.testReleaseSearchForm.reset();
    qs_1.resetQuickSearchCntrl();
}

</SCRIPT>

<BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
	<TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

	<!-- Side Navigation start -->
	<%@ include file="/jsp/operations/releaseMenu.jsp" %></TD>
	<!-- end of the side navigations -->

	<TD bgcolor="#ffffff">
	<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
	<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
	<TD valign="top" width="100%">

	<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
	<BR>

	<html:form action="/newTestRelease?action=search" name="testReleaseSearchForm" type="com.scalar.chiptrack.operations.release.forms.TestReleaseSearchForm" method="POST">
	<TABLE width="95%" align="right" cellpadding="2" cellspacing="2" border="0">
		<TR><TD colspan="4" class="NArialW" align="center">Program Release Form Selection</TD></TR>
		<TR><TD colspan='4' align="left" class='NArialL'>&nbsp;<FONT id="errors" color='FF0000'></font></TD></TR>
		<TR><TD colspan='4' class="NArialL"><chiptrack:errors styleClass="NArialL"/></TD></TR>
		<TR><TD colspan='4' class="NArialL"><chiptrack:info styleClass="NArialL"/></TD></TR>
		<TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>

        <tr>
            <td class="NArialL" width='30%'>
                Quick Search <bean:message key="label.mfgPartNumber"/>:
            </td>
            <td class="NArialL" width='20%'>
                <input type="text" name="qs1" class="txfield" size='12' onkeyup='quickSearch(qs_1)'/>
            </td>
                <td colspan='2' width='50%'>&nbsp;</td>
            </tr>

        <tr>
			<td class="NArialL">
				<bean:message key="label.mfgPartNumber"/>:
			</td>
			<td class="NArialL">
			<html:select name="testReleaseSearchForm" property="processStep_ID"  styleClass="txfield">
				<html:option value="-1">All</html:option>
				<html:options collection="partNumberList" property="value" labelProperty="label"/>
			</html:select>
			</td>
			<td class="NArialL">Sales Order #:
			</td>
			<td class="NArialL"><html:text name="testReleaseSearchForm" property="salesOrder_No" styleClass="txfield"/>
			</td>
		</tr>
		<TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='5'></TD></TR>
        <tr>
			<td class="NArialL">
				To Customer:
			</td>
			<td class="NArialL">
			<html:select name="testReleaseSearchForm" property="customer_ID"  styleClass="txfield">
				<html:options collection="customerList" property="value" labelProperty="label"/>
			</html:select>
			</td>
            <td class="NArialL">
				Vendor:
			</td>
			<td class="NArialL">
 			<html:select name="testReleaseSearchForm" property="vendor_ID" styleClass="txfield">
				<html:options collection="locationList" property="value" labelProperty="label"/>
			</html:select>
 			</td>
		</tr>
        <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
		<tr>
			<td colspan="4" align="center">
                 <input type=image border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17" onmouseover="window.status='Click to create Programming Request Form';return true" onmouseout="window.status='';return true" title="Click here to Search for Program Request Form">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="javascript:reset();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17" onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true" title="Click here to Reset"></a>
			</td>
		</tr>
		<tr>
				<td colspan="4" align="center">&nbsp;</td>
		</tr>
		<logic:present name="backLogtList">
        <tr><td colspan='4'>
			<TABLE border=0 cellspacing=3 cellpadding=2 class='NArialL'>
				<tr>
					<td bgcolor="#993333" width="10%" align="center"><font color="#FFFFFF">Sales Order#</font></td>
					<td bgcolor="#993333" width="10%" align="center"><font color="#FFFFFF">LineItem #</font></td>
                    <td bgcolor="#993333" width="10%" align="center"><font color="#FFFFFF">Shipment #</font></td>
					<td bgcolor="#993333" width="15%" align="center"><font color="#FFFFFF"><bean:message key="label.mfgPartNumber"/></font></td>
					<td bgcolor="#993333" width="15%" align="center"><font color="#FFFFFF">Customer</font></td>
					<td bgcolor="#993333" width="10%" align="center"><font color="#FFFFFF">Req Qty</font></td>
					<td bgcolor="#993333" width="10%" align="center"><font color="#FFFFFF">Request Date</font></td>
					<td bgcolor="#993333" width="10%" align="center"><font color="#FFFFFF">Schedule Date</font></td>
                    <td bgcolor="#993333" width="10%" align="center"><font color="#FFFFFF">Order Type</font></td>
					<td bgcolor="#993333" width="20%" align="center" colspan="4"><font color="#FFFFFF">Actions</font></td>
				</tr>

				<logic:iterate id="backLog" name="backLogtList" indexId="iteratorIdx" type="com.scalar.chiptrack.operations.release.ProgramReleaseObject">
                <tr <%if(iteratorIdx.intValue()%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>>
					<td width="10%" align="center"><bean:write name="backLog" property="salesOrderNo"/></td>
					<td width="10%" align="center"><bean:write name="backLog" property="lineItem_No"/></td>
                    <td width="10%" align="center"><bean:write name="backLog" property="shipmentNumber"/></td>
					<td width="15%" align="center"><bean:write name="backLog" property="partNumber"/></td>
					<td width="15%" align="center"><bean:write name="backLog" property="customerName"/></td>
					<td width="10%" align="center"><bean:write name="backLog" property="reqQty"/></td>
					<td width="10%" align="center"><bean:write name="backLog" property="reqDate"/></td>
					<td width="10%" align="center"><bean:write name="backLog" property="scheDate"/></td>
                    <td width="10%" align="center"><bean:write name="backLog" property="orderType"/></td>
					<td width="20%" align="center">
						<font class="NArialL">
						<A Href='<%=chipTracContext%>/testRelease.do?action=release&salesOrder_Id=<bean:write name="backLog" property="salesOrder_Id"/>&lineItem_Id=<bean:write name="backLog" property="lineItem_Id"/>&vendor_Id=<%=vendorID%>' onmouseover="window.status='Click to Generate Programming Release';return true" onmouseout="window.status='';return true">
						<bean:message key="label.packingSlip.Generate"/>
						</A>
					</td>
				</tr>
				</logic:iterate>
                </TABLE>

        </td></tr>

		</logic:present>

		</TABLE>
	</html:form>
<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</BODY>
</HTML>